<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTemplatesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('templates', function (Blueprint $table) {
            $table->id();
            $table->string('title')->nullable()->comment('模板名称');
            $table->string('name')->nullable()->comment('模板标识');
            $table->string('description')->comment('模块描述');
            $table->string('author')->comment('作者');
            $table->string('email')->comment('作者邮箱');
            $table->string('preview')->comment('预览图');
            $table->string('version')->comment('版本号');
            $table->boolean('installed')->default(false)->comment('是否安装');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('templates');
    }
}
